import { createRouter, createWebHashHistory, type RouteRecordRaw } from 'vue-router'

const routes: RouteRecordRaw[] = [
  { path: '/', redirect: '/login' },
  { path: '/login', component: () => import('@/views/GxLogin.vue') },
  {
    path: '/control',
    component: () => import('@/views/GxControl.vue'),
    children: [
      { path: '', redirect: '/control/home' },
      { path: 'home', component: () => import('@/views/GxHome.vue') },
      { path: 'admin', component: () => import('@/views/GxAdmin.vue') },
    ]
  },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
